import React from 'react'; //react核心库
import ReactDOM from 'react-dom'; //reactdom操作库
import './index.css'; //全局样式
import App from './App'; //引入根组件

// Provider 能够将redux创建的store 注入到根组件
import myReducer from './pages/reducer/index'
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux'
import reportWebVitals from './reportWebVitals';

// redux的中间件  是让redux 处理更加强大

import ThunkMiddleWare from 'redux-thunk'
import logger from './logger'
let store = createStore(myReducer, applyMiddleware(ThunkMiddleWare, logger)) //创建公共数据管理仓库对象

console.log(store.getState())
//react-redux  帮助redux和react项目进行连接的

// React.StrictMode 严格 模式渲染
ReactDOM.render(
  // <React.StrictMode>
  <Provider store={store}>
    <App />
  </Provider>

  // </React.StrictMode >
  ,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
